package com.itheima.chapter07.exception;



import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

//编译时异常
public class throws2 {
    public static void main(String[] args) throws ParseException{
        //throws ParseException
        //继续交给调用者而main方法调用是虚拟机
        method();
    }

    private static void method() throws ParseException {
        SimpleDateFormat sdf =new SimpleDateFormat("yyyy年MM月dd日");
        String s ="2048-11-02";
        Date d = sdf.parse(s);
        System.out.println(d);

    }
}
